const httpRequest = require('../utils/request')

/** 登录 */
export const handleLogin = (data) =>{
  return httpRequest.post('/web/home/usrRegister',data)
}

/** 首页 */
export const getHomeData = (data) =>{
  return httpRequest.get('/web/home/index',data)
}

/** 更新用户手机号  */
export const updateUserPhone = (data) =>{
  return httpRequest.get('/web/home/update/phone',data)
}

/** 获取个人资料  */
export const getUserInfo = (data) =>{
  return httpRequest.get('/web/coffee/profile',data)
}

/** 获取商品列表  */
export const getGoodsList = (data) =>{
  return httpRequest.get('/web/coffee/list',data)
}

/** 获取订单可用优惠券  */
export const getOrderCoupon = (data) =>{
  return httpRequest.post('/web/coffee/orderVoucher',data)
}

/** 生成订单  */
export const createOrder = (data) =>{
  return httpRequest.post('/web/coffee/makeOrder',data)
}

/** 获取充值列表  */
export const getRechargeList = (data) =>{
  return httpRequest.get('/web/coffee/chargeRules',data)
}

/** 充值  */
export const recharge = (data) =>{
  return httpRequest.post('/web/charge/pay',data)
}

/** 获取订单列表  */
export const getOrderList = (data) =>{
  return httpRequest.get('/web/consume/myOrders',data)
}

/** 所有优惠券  */
export const getCouponList = (data) =>{
  return httpRequest.get('/web/coffee/myVouchers',data)
}

/** 计算订单 */
export const calculateOrder = (data) =>{
  return httpRequest.post('/web/coffee/calcOrder',data)
}

/** 获取顶部商品  */
export const getTopGood = (data) =>{
  return httpRequest.get('/web/coffee/topDrink',data)
}

/** 获取福利列表 */
export const getWelfareList = () => {
  return httpRequest.get('/web/reward/getRewardTasks')
}

/** 领取福利 */
export const receiveWelfare = (data) => {
  return httpRequest.get('/web/reward/withDrawReward', data)
}

/** 获取配置价格 */
export const getConfigPrice = (data) => {
  return httpRequest.get('/web/coffee/getExtraPrice', data)
}

/** 获取配置价格 */
export const getCounsumeList = (data) => {
  return httpRequest.get('/web/consume/counsumeList', data)
}
